Repository navigation
test: verify correct contact email - #2
marcospampi wants to merge 2 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| @@ -0,0 +1,11 @@ | |||
| import re | |||
|
|
||
| from playwright.sync_api import Page, expect | ||
|
|
||
| def test_contact_email(page: Page): |
There was a problem hiding this comment.
manca il tipo di ritorno, ex def test_contact_email(page: Page) -> None:
| from playwright.sync_api import Page, expect | ||
|
|
||
| def test_contact_email(page: Page): | ||
| page.goto('/contact') |
There was a problem hiding this comment.
qui usi i tab al posto di 4 spazi, e mancano il newline a fine file e la seconda riga vuota prima della def, puoi lanciare black tests/test_contact_email.py
| contact_email = page.get_by_test_id('contact-email') | ||
|
|
||
| expect(contact_email).to_have_text('student.office@example.com') | ||
| expect(contact_email).to_have_url('mailto:student.office@example.com') No newline at end of file |
There was a problem hiding this comment.
to_have_url c'è solo su expect(page), su un locator il test va in AttributeError, per il link puoi usare to_have_attribute("href", "mailto:student.office@example.com")
| from playwright.sync_api import Page, expect | ||
|
|
||
|
|
||
| def test_contact_email(page: Page) -> None: |
There was a problem hiding this comment.
ora il README chiede anche i pattern Page Object e BDD per ogni esercizio, puoi fare come nella #5, ex una ContactPage in pages e lo scenario in tests/features
No description provided.